import request from '@/utils/request'

/**
 * 导出验收结果图片
 * @param param
 * @return {*}
 */
export function downloadCheckResultFile(param) {
  return request({
    url: '/gcxt/export/downloadCheckResult',
    method: 'post',
    timeout: 0,
    data: param
  })
}

/**
 * 导出验收完成情况报表
 * @param param
 * @return {*}
 */
export function downloadCompletionReport(param) {
  return request({
    url: '/gcxt/export/downloadCompletionReport',
    method: 'get',
    timeout: 0,
    params: param,
    responseType: 'blob'
  }, {
    source: true
  })
}

/**
 * 导出验收完成情况报表
 * @param param
 * @return {*}
 */
export function downloadProcessStandingBook(param) {
  return request({
    url: '/gcxt/export/downloadProcessStandingBook',
    method: 'POST',
    timeout: 0,
    data: param,
    responseType: 'blob'
  }, {
    source: true
  })
}

/**
 * 导入抽检得分完成情况报表
 * @param param
 * @return {*}
 */
export const IMPORT_FILE_UPLOAD_URL = process.env.VUE_APP_BASE_API + '/cq/cqEvalPrjchk/importRdcData'
export function importRdcData(data) {
  return request({
    url: '/cq/cqEvalPrjchk/importRdcData',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: data,
    responseType: 'blob'
  }, {
    source: true
  })
}
/**
 * 导入抽检得分完成情况报表 模板校验
 * @param param
 * @return {*}
 */

export const CHECK_FILE_UPLOAD_URL = process.env.VUE_APP_BASE_API + '/cq/cqEvalPrjchk/exportError'
export function exportError(data) {
  return request({
    url: '/cq/cqEvalPrjchk/exportError',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: data,
    responseType: 'blob'
  }, {
    source: true
  })
}

/**
 * 导出工序月份统计报表
 * @param param
 * @return {*}
 */
export function downloadProcessMonthStatistics(param) {
  return request({
    url: '/gcxt/export/downloadProcessMonthStatistics',
    method: 'GET',
    timeout: 0,
    params: param,
    responseType: 'blob'
  }, {
    source: true
  })
}
